package dsk.demo.miaosha.demo.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class MQSender {

    @Autowired
    RabbitTemplate rabbitTemplate;

    public void sendSeckillMessage(SeckillMessage msg){

        rabbitTemplate.convertAndSend("seckillExchange","seckill.message",msg);
    }

    public void send(String msg){
        rabbitTemplate.convertAndSend("queue",msg);
    }
}
